package org.springblade.modules.admin.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springblade.modules.admin.entity.MaintainPartsWork;
import org.springblade.modules.admin.vo.PartsMessageVO;
import org.springblade.modules.admin.vo.PartsSimpleInfoVO;
import org.springblade.modules.admin.vo.parts.PartsWorkDetailVO;

import java.util.List;
import java.util.Map;

public interface MaintainPartsWorkMapper extends BaseMapper<MaintainPartsWork> {


	/**
	 * 用来关联获取创建人和当前的工单状态
	 * 获取申请的部件明细
	 * @param id 主键id
	 * @return 数据集
	 */
    MaintainPartsWork getDetailById(Long id);

	/**
	 * 根据流程实例id查询申请配件工单基本信息
	 * @param processInstanceId
	 * @return
	 */
	PartsSimpleInfoVO getPartsSimpleInfo(@Param("processInstanceId") String processInstanceId);

	/**
	 * 根据工单id查询申请配件工单基本信息
	 * @param planId 工单id
	 * @return
	 */
	PartsSimpleInfoVO getPartsSimpleInfoByPlanId(@Param("planId") Long planId);


    PartsWorkDetailVO selectPartsWorkDetail(@Param("planId") Long planId);

    List<MaintainPartsWork> selectOldMalRelationParts();

	/**
	 * 获取配件工单已退回的数量
	 * @return 数量
	 */
    int rejectCount();

	/**
	 * 配件菜单角标统计
	 * @return
	 */
	Map<String, Integer> partApproveIcon();

	List<MaintainPartsWork> selectListByPlan(Long planId);

	List<MaintainPartsWork> selectListByPlans(List<Long> planIds);

    PartsMessageVO selectPartsMessage(@Param("planId") String planId);
}
